package com.qingke.notlonely.bean;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name="school")
public class School {
	@Id
	@Column(name="id")
	private int id;
	@Column(name="name")
	private String name;
	@OneToMany(mappedBy="school",fetch=FetchType.LAZY)
	private Set<Eduction> eductions;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Set<Eduction> getEductions() {
		return eductions;
	}
	public void setEductions(Set<Eduction> eductions) {
		this.eductions = eductions;
	}
	@Override
	public String toString() {
		return name;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		School other = (School) obj;
		if (id != other.id)
			return false;
		return true;
	}
	
}
